package com.sopra.tecnica.poc.server.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.sopra.tecnica.poc.server.entity.CustomerEntity;
import com.sopra.tecnica.poc.server.service.CustomerService;

@Controller
@RequestMapping("customer")
public class CustomerController {
	
	@Autowired
	private CustomerService customerService;
	
	@RequestMapping("user")
	public void findUserCustomers(@RequestParam("code") String code,
			Model model) {
		List<CustomerEntity> result = customerService.findUserCustomers(code);
		model.addAttribute(result);
	}
}
